package lab03.Test07;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

/**
 * Created by 14394 on 2017/11/17.
 */
public class Test {
    public static void main(String[] args) {
        String path="D:\\dev\\sctu-java-2017-1.zip";
        ZipInputStream zipInputStream=null;
        try {
            zipInputStream=new ZipInputStream(new FileInputStream(path));
            ZipEntry entry;
            while ((entry=zipInputStream.getNextEntry())!=null){
                System.out.println(entry.getTime());
                System.out.println(entry.getMethod());
            }

            zipInputStream.getNextEntry();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (zipInputStream!=null){
                try {
                    zipInputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
